angular.module('mamApp').factory('AlbumManager', ['$http', 'api', 'paramsManager', function ($http, api, paramsManager) {
    var AlbumManager = {

        /**
         * 专辑编辑
         * @param params
         * @returns
         */

        albumEdit: function (albumId, params) {
            return $http.put(api + '/admin/albums/' + albumId, params).then(function (result) {
                return result;
            });
        },
        /**
         * 专辑列表
         * @param params[pageNo,pageSize]
         * @returns result
         */
        albumList: function (params, query) {
            return $http.get(api + '/admin/albums/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 专辑详情
         * @returns result
         */
        albumDetail: function (albumId) {
            return $http.get(api + '/admin/albums/' + albumId).then(function (result) {
                return result;
            });
        },
        /**
         * 专辑调整频道
         * @returns result
         */
        albumAdjustChannel: function (ids, params) {
            return $http.put(api + '/admin/albums/' + ids.join(",") + '/channel', params).then(function (result) {
                return result;
            });
        },
        /**
         * 同一个专辑下面的审核人列表
         * @returns result
         */
        albumProgramUsers: function (albumId) {
            return $http.get(api + '/admin/album/' + albumId + '/programs/adminUsers').then(function (result) {
                return result;
            });
        },
        /**
         * 专辑下面审核人的列表
         * @returns result
         */
        albumsCheckUsers: function () {
            return $http.get(api + '/admin/albums/adminUsers').then(function (result) {
                return result;
            });

        },
        albumProgramDragSort: function (albumId, params) {
            return $http.put(api + '/admin/album/'+albumId+'/programSorts',params).then(function (result) {
                return result;

            })
        }


    };

    return AlbumManager;
}]);
